<template>
  <view class="pic-grid-container">
    <image v-for="item in picGridData.imgs_" :key="item.seq_" @tap="go(item)" class="pic-grid" :src="item.img_"
      mode="widthFix">
    </image>
  </view>
</template>

<script setup lang="ts">
import type { floorsState, bannerItemData } from "@/types/home";
defineProps<{ picGridData: floorsState }>()

const go = (item: bannerItemData) => {
  switch (item.target_.type_) {
    case 1:
      uni.navigateTo({ url: `/pages/category/goodsDetail?id=${item.target_.val_}` })
      break;
    case 7:
      uni.navigateTo({ url: `/pages/index/home?templateId=${item.target_.val_}` })
      break;
  }
}
</script>

<style lang="scss" scoped>
.pic-grid-container {
  width: 100%;
  // height: var(--height);
  display: flex;
  justify-content: flex-start;

  .pic-grid {
    width: 100%;
  }
}
</style>
